home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 22 / Cream of the Crop 22.iso / os2 / be.zip / bememext.h < prev   
C/C++ Source or Header  |  1996-08-28  |  2KB  |  68 lines

  1. //
  2. // bememext.h - Interface needed by implementors of BE memory extension helpers
  3. //
  4. // Despite both BE and the helpers being implemented in C++, I use a C
  5. // style interface. This avoids name mangling problems.
  6. //
  7. // The bemem_init entrypoint will be called before any other entrypoint.
  8. // If bemem_init fails, then it should set err to point to some meaningful
  9. // static error string, and return FALSE.
  10. //
  11. // For every non-0 bemem_create, BE will later call bemem_delete.
  12. // If bemem_create fails, then it should set err to point to some meaningful
  13. // static error string, and return (void *) 0.
  14. //
  15. // After all bemem_deletes, bemem_term will be called (last).
  16. //
  17. // If the memory extension helper is caching data (presumably for speed),
  18. // then it should discard this cache if bemem_refresh is called.
  19. //
  20. // A memory extension helper can optionally provide the bemem_write and
  21. // bemem_flush routines, if the data it provides access to is in some way
  22. // modifiable. bemem_write changes a byte in the data, and before the
  23. // Binary Editor shuts down, it will call bemem_flush to make any changes
  24. // made using bemem_write 'final'. If data is modified via bemem_write,
  25. // the modified data should immediately be accessible via bemem_read.
  26. //
  27.  
  28. #ifndef BEMEM_H
  29. #define    BEMEM_H
  30.  
  31. #ifndef Boolean_DEFINED
  32. #define    Boolean_DEFINED
  33. typedef int Boolean;
  34. #define    TRUE  1
  35. #define FALSE 0
  36. #endif
  37.  
  38. #if   defined(OS2)
  39. #define    BEMEMEXPORT
  40. #define    BEMEMENTRY _System
  41. #elif defined(WIN32)
  42. #define    BEMEMEXPORT __declspec(dllexport)
  43. #define    BEMEMENTRY __stdcall
  44. #else
  45. #define    BEMEMEXPORT
  46. #define    BEMEMENTRY
  47. #endif
  48.  
  49. #ifdef AIX
  50. typedef void (*BEMEM_EP)(void);
  51. typedef struct { BEMEM_EP ep; const char *name; } BEMEM_EXPORT;
  52. #endif
  53.  
  54. extern "C" {
  55.  
  56. BEMEMEXPORT Boolean BEMEMENTRY bemem_read(void * ptr, unsigned addr, unsigned char & b);
  57. BEMEMEXPORT void    BEMEMENTRY bemem_refresh(void * ptr);
  58. BEMEMEXPORT Boolean BEMEMENTRY bemem_write(void * ptr, unsigned addr, unsigned char b);
  59. BEMEMEXPORT Boolean BEMEMENTRY bemem_flush(void * ptr);
  60. BEMEMEXPORT void *  BEMEMENTRY bemem_create(const char *args, unsigned addr, char *(&err));
  61. BEMEMEXPORT void    BEMEMENTRY bemem_delete(void * ptr);
  62. BEMEMEXPORT Boolean BEMEMENTRY bemem_init(char *(&err));
  63. BEMEMEXPORT void    BEMEMENTRY bemem_term();
  64.  
  65. }
  66.  
  67. #endif
  68.